import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false

App.mpType = 'app'

// 模拟所有需要的 API 方法
Vue.prototype.$api = {
  getCategoryList() {
    return new Promise(resolve => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: [
            { id: 1, name: '美容护肤', icon: '/static/category1.jpg' },
            { id: 2, name: '整形手术', icon: '/static/category2.jpg' },
            { id: 3, name: '健康养生', icon: '/static/category3.jpg' },
            { id: 4, name: '美发造型', icon: '/static/category4.jpg' },
            { id: 5, name: '美甲美睫', icon: '/static/category5.jpg' }
          ]
        })
      }, 500)
    })
  },
  
  getActivityList() {
    return new Promise(resolve => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: [
            { id: 1, title: '夏日美容狂欢', price: '199', originalPrice: '399', image: '/static/activity1.jpg' },
            { id: 2, title: '秋季整形特惠', price: '299', originalPrice: '599', image: '/static/activity2.jpg' },
            { id: 3, title: '冬季养生套餐', price: '99', originalPrice: '299', image: '/static/activity3.jpg' }
          ]
        })
      }, 500)
    })
  },
  
  getFlashSaleList() {
    return new Promise(resolve => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: [
            { id: 1, title: '限时特惠水光针', price: '199', originalPrice: '399', image: '/static/flash1.jpg', progress: 68, sold: 68 },
            { id: 2, title: '玻尿酸填充套餐', price: '299', originalPrice: '599', image: '/static/flash2.jpg', progress: 82, sold: 82 },
            { id: 3, title: '光子嫩肤体验', price: '99', originalPrice: '299', image: '/static/flash3.jpg', progress: 45, sold: 45 }
          ]
        })
      }, 500)
    })
  },
  
  getDoctorRanking() {
    return new Promise(resolve => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: [
            { id: 1, name: '张医生', title: '皮肤科主任医师', image: '/static/doctor1.jpg' },
            { id: 2, name: '李医生', title: '整形美容科医师', image: '/static/doctor2.jpg' },
            { id: 3, name: '王医生', title: '牙科专家', image: '/static/doctor3.jpg' }
          ]
        })
      }, 500)
    })
  },
  
  getHospitalRanking() {
    return new Promise(resolve => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: [
            { id: 1, name: 'XX医疗美容医院', address: 'XX路XX号', image: '/static/hospital1.jpg' },
            { id: 2, name: 'YY整形美容中心', address: 'YY路YY号', image: '/static/hospital2.jpg' },
            { id: 3, name: 'ZZ健康养生会所', address: 'ZZ路ZZ号', image: '/static/hospital3.jpg' }
          ]
        })
      }, 500)
    })
  },
  
  getTabContentData() {
    return new Promise(resolve => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: {
            selected: [
              { id: 1, title: '美白套餐', desc: '提亮肤色 补水保湿', image: '/static/selected1.jpg' },
              { id: 2, title: '玻尿酸填充', desc: '丰盈面部 改善细纹', image: '/static/selected2.jpg' }
            ],
            diary: [
              { id: 3, title: '术后恢复日记', desc: '真实体验分享', image: '/static/diary1.jpg' },
              { id: 4, title: '日常护肤技巧', desc: '专家分享', image: '/static/diary2.jpg' }
            ]
          }
        })
      }, 500)
    })
  }
}

const app = new Vue({
  ...App
})
app.$mount()